package com.sense.kukoo.biz_messages.model

import com.sense.kukoo.common.mvvm.model.BaseMvvmModel
import com.sense.kukoo.common.repo.bean.ResultBean
import com.sense.kukoo.common.repo.http.KukooHttpApi
import com.sense.kukoo.common.repo.http.KukooHttpManager
import com.sense.kukoo.common.repo.http.bean.UserMessageSystemBean
import okhttp3.RequestBody

class MessagesSystemsModel: BaseMvvmModel() {

    private val TAG: String = javaClass.simpleName

    override fun onModelCleared() {}

    suspend fun messageSystems(pageIndex: Int, pageSize: Int, type: Int): ResultBean<ArrayList<UserMessageSystemBean>> {
        val hashMap = HashMap<String, Any>()
        if(false){
            hashMap.put("currentUserId", "")
            hashMap.put("limit1", "")
            hashMap.put("limit2", "")
        }
        hashMap.put("pageIndex", pageIndex)
        hashMap.put("pageSize", pageSize)
        hashMap.put("type", type)
        val mRequestBody: RequestBody = KukooHttpManager.createRequestBody(hashMap)

        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .messageSystems(mRequestBody)
    }
}